namespace CCAI.Office.PowerPoint.TimedText.Captions
{
    /// <summary>
    /// Represents a length to be applied to a caption property..
    /// </summary>
    public class Length
    {
        /// <summary>
        /// The numeric value of this length.
        /// </summary>
        public float Value { get; set; }

        /// <summary>
        /// The unit of this length.
        /// </summary>
        public LengthUnit Unit { get; set; }

        public float ToPixelLength(float containerLength = 0)
        {
            return Unit == LengthUnit.Percent
                       ? Value*containerLength
                       : Value;
        }
    }

    
}